|
|
|
|
|
|
|
by some server subsystem independent of the client. Listing 20.1 shows a form controller method, showForm, that displays information to the user with a SQL statement. |
|
|
|
|
|
|
|
|
LISTING 20.1. AN EXAMPLE OF A FORM CONTROLLER THAT DIRECTLY CONTROLS THE FLOW OF INFORMATION FROM THE DATABASE ACCESS SUBSYSTEM TO THE GRAPHICAL USER INTERFACE SUBSYSTEM. |
|
|
|
 |
|
|
|
|
1:
2: Public Sub showForm()
3: Dim sSQL As String
4: sSQL = sSQL & SELECT [PubID],[Name],[Company Name],[Telephone]
5: sSQL = sSQL & FROM [Publishers] Order by [PubID]
6:
7: With theDBSubsystem
8: sSQL = .theCommandBroker.CurrSQL
9: .DBResultset.openDBResultset sSQL,
theDBSubsystem.DBConnection.pDBConnection
10: End With
11: Set theForm = New frmPublishers
12: displayCurrentRecord
13: theForm.Show
14: End Sub
15: |
|
|
|
|
|
|
|
|
theDBSubsystem is the instance of the data access interface class, IDBSubsystem. theCommandBroker is the class instance of CommandBroker, which is responsible for managing the references to SQL statements, ADO Command objects, RDO rdoQuery objects, and similar objects. DBResultset is the resultset (or recordset) object reference owned by theDBSubsystem. DBConnection is the reference to the connection object facade also owned by theDBSubsystem. DBConnection, in turn, has the property, pDBConnection, which is the actual connection object reference. theForm is the reference to frmPublishers. Finally, displayCurrentRecord is the controller's method responsible for displaying the current record. The controller classes in the Second Bank of Carrollton example follow this general pattern. |
|
|
|
|
|
|
|
|
New Term: A proxy class is a class that acts as a stand-in for a remote subsystem or component. |
|
|
|
|
|
|
|
|
Interfacing Between the Reporting and Printing and the Graphical User Interface Subsystems |
|
|
|
|
|
|
|
|
When a user requests a report in a GUI-based system, he or she typically selects a report on a form. The form delegates the request to its controller. From there, the form |
|
|
|
|
|